<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>弹性盒子一行多列</title>
    <style>
        * {
            padding: 0px;
            margin: 0px;
            list-style: none;
        }

        .ul-container {
            /* 成为弹性盒子容器 */
            display: flex;
            width: 1200px;
            margin: auto;
            /* 换行 */
            flex-wrap: wrap;
            /* 次轴对齐方式 */
            align-items: center;
        }

        .ul-container>li {
            width: 20%;
            padding: 10px;
            box-sizing: border-box;
            border: 1px solid #000;
            background-color: #ff0;
        }
    </style>
</head>
<body>
    <ul class="ul-container">
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
        <li>5</li>
        <li>6</li>
        <li>7</li>
        <li>8</li>
        <li>9</li>
        <li>10</li>
        <li>11</li>
        <li>12</li>
    </ul>
</body>
</html>